home *** CD-ROM | disk | FTP | other *** search
/ PC Open 101 / PC Open 101 CD 1.bin / CD1 / grafica / The Gimp / gimp-help-2-0.3-setup.exe / {app} / share / gimp / 2.0 / help / en / ch05s07s02.html < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-20  |  11.2 KB  |  287 lines

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4.   <head>
  5.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6.     <title>7.2.┬áConvolution matrix</title>
  7.     <link rel="stylesheet" href="gimp-help-plain.css" type="text/css" />
  8.     <link rel="stylesheet" href="gimp-help-screen.css" type="text/css" />
  9.     <meta name="generator" content="DocBook XSL Stylesheets V1.64.1" />
  10.     <link rel="home" href="index.html" title="GIMP User Manual" />
  11.     <link rel="up" href="ch05s07.html" title="7.┬áGeneric filters" />
  12.     <link rel="previous" href="ch05s07.html" title="7.┬áGeneric filters" />
  13.     <link rel="next" href="ch05s07s03.html" title="7.3.┬áDilate" />
  14.   </head>
  15.   <body>
  16.     <div class="navheader">
  17.       <table width="100%" summary="Navigation header">
  18.         <tr>
  19.           <th colspan="3" align="center">7.2.┬áConvolution matrix</th>
  20.         </tr>
  21.         <tr>
  22.           <td width="20%" align="left"><a accesskey="p" href="ch05s07.html">Prev</a>┬á</td>
  23.           <th width="60%" align="center">7.┬áGeneric filters</th>
  24.           <td width="20%" align="right">┬á<a accesskey="n" href="ch05s07s03.html">Next</a></td>
  25.         </tr>
  26.       </table>
  27.       <hr />
  28.     </div>
  29.     <div class="sect2" lang="en" xml:lang="en">
  30.       <div class="titlepage">
  31.         <div>
  32.           <div>
  33.             <h3 class="title"><a id="plug-in-convmatrix"></a>7.2.┬áConvolution matrix</h3>
  34.           </div>
  35.         </div>
  36.         <div></div>
  37.       </div>
  38.       <a id="id2976114" class="indexterm"></a>
  39.       <div class="mediaobject">
  40.         <img src="../images/filters/filters-generic-convolution.png" />
  41.       </div>
  42.       <div class="simplesect" lang="en" xml:lang="en">
  43.         <div class="titlepage">
  44.           <div>
  45.             <div>
  46.               <h4 class="title"><a id="id2976146"></a>Overview</h4>
  47.             </div>
  48.           </div>
  49.           <div></div>
  50.         </div>
  51.         <div class="variablelist">
  52.           <dl>
  53.             <dt></dt>
  54.             <dd>
  55.               <p>
  56.             This filter is found in 
  57.             <span class="guimenuitem">Image>Filters/Generic/<span class="accel">C</span>onvolution Matrix</span>  
  58.           </p>
  59.               <p>
  60.             Here is a mathematician's domain. Most of filters are using convolution matrix. With the 
  61.             Convolution Matrix filter, if the fancy takes you, you can build a custom filter. 
  62.           </p>
  63.               <p>
  64.             What is a convolution matrix? It's possible to get a rough idea of it without using 
  65.             mathematical tools that only a few ones know. Convolution is the treatment of a matrix 
  66.             by another one which is called "kernel". 
  67.           </p>
  68.               <p>
  69.             The Convolution Matrix filter uses a first matrix which is the Image to be treated. 
  70.             The image is a bi-dimensionnal collection of pixels in rectangular coordinates. The 
  71.             used kernel depends on the effect you want.
  72.           </p>
  73.               <p>
  74.             GIMP uses 5x5 or 3x3 matrices. We will consider only 3x3 matrices, they are the most used 
  75.             and they are enough for all effects you want. If all border values of a kernel are set to 
  76.             zero, then system will consider it as a 3x3 matrix.
  77.           </p>
  78.               <p>
  79.             The filter studies successively every pixel of the image. For each of them, that we will 
  80.             name "initial pixel", it multiplies value of this pixel and values of the 8 surrounding 
  81.             pixels by the kernel corresponding value. Then it adds results and the initial pixel 
  82.             takes this final result value.
  83.           </p>
  84.               <p>
  85.             A simple example:
  86.             <img src="../images/filters/examples/convolution-example1.png" />
  87.             On the left is the image matrix: each pixel is marked with its value. The initial pixel has 
  88.             a red border. The kernel action area has a green border. In middle is the kernel and, on 
  89.             the right, is the convolution result.
  90.           </p>
  91.               <p>
  92.             Here is what happened: the filter read successively, from left to right and from top to 
  93.             bottom, all the pixels of the kernel action area. It multiplied the value of each of them 
  94.             by the kernel corresponding value and added results: (100*0)+(50*1)+(50*0)*(100*0)+(100*0) 
  95.             +(100*0)+(100*0)+(100*0)+(100*0)+(100*0) = 50. The initial pixel tooks value 50. Previously, 
  96.             when the initial pixel had value=50, it tooks the value 100 of above pixel (filter doesn't 
  97.             work on image but on a copy) and so disappeared into the "100" background pixels. As a 
  98.             graphical result, the initial pixel moved a pixel downwards. 
  99.           </p>
  100.             </dd>
  101.           </dl>
  102.         </div>
  103.       </div>
  104.       <div class="simplesect" lang="en" xml:lang="en">
  105.         <div class="titlepage">
  106.           <div>
  107.             <div>
  108.               <h4 class="title"><a id="id2976240"></a>Options</h4>
  109.             </div>
  110.           </div>
  111.           <div></div>
  112.         </div>
  113.         <div class="variablelist">
  114.           <dl>
  115.             <dt>
  116.               <span class="term">Matrix</span>
  117.             </dt>
  118.             <dd>
  119.               <p>
  120.             This is the 5x5 kernel matrix: you enter wanted values directly into boxes.
  121.           </p>
  122.               <p>
  123.             <span class="guilabel">Divisor</span>: The result of previous calculation will be divided by 
  124.             this divisor. You will hardly use 1, that lets result unchanged, and 9 or 25 
  125.             according to matrix size, that gives the average of pixel values.
  126.           </p>
  127.               <p>
  128.             <span class="guilabel">Offset</span>: this value is added to the division result. This is 
  129.             useful if result may be negative. This offset may be negative.
  130.           </p>
  131.             </dd>
  132.             <dt>
  133.               <span class="term">Border</span>
  134.             </dt>
  135.             <dd>
  136.               <p>
  137.             When the initial pixel is on a border, a part of kernel is out of image. You have to 
  138.             decide what filter must do:
  139.           </p>
  140.               <div class="mediaobject">
  141.                 <img src="../images/filters/filters-convolution-milord.png" />
  142.               </div>
  143.               <div class="itemizedlist">
  144.                 <ul type="disc">
  145.                   <li>
  146.                     <p>
  147.                 <span class="guilabel">Extend</span>: this part of kernel is not taken into acount.
  148.               </p>
  149.                     <div class="mediaobject">
  150.                       <img src="../images/filters/filters-convolution-extend.png" />
  151.                     </div>
  152.                   </li>
  153.                   <li>
  154.                     <p>
  155.                 <span class="guilabel">Wrap</span>: this part of kernel will study pixels of the opposite 
  156.                 border, so pixels disappearing from one side reappear on the other side.
  157.               </p>
  158.                     <div class="mediaobject">
  159.                       <img src="../images/filters/filters-convolution-wrap.png" />
  160.                     </div>
  161.                   </li>
  162.                   <li>
  163.                     <p>
  164.                 <span class="guilabel">Crop</span>: Pixels on borders are not modified, but they are cropped.
  165.               </p>
  166.                     <div class="mediaobject">
  167.                       <img src="../images/filters/filters-convolution-crop.png" />
  168.                     </div>
  169.                   </li>
  170.                 </ul>
  171.               </div>
  172.             </dd>
  173.             <dt>
  174.               <span class="term">Channels</span>
  175.             </dt>
  176.             <dd>
  177.               <p>
  178.             You can select there one or several channels the filter will work with.
  179.           </p>
  180.             </dd>
  181.             <dt>
  182.               <span class="term">Automatic</span>
  183.             </dt>
  184.             <dd>
  185.               <p>
  186.             If this option is checked, The Divisor takes the result value of convolution. If 
  187.             this result is equal to zero (it's not possible to divide by zero), then a 128 
  188.             offset is applied. If it is negative ( a negative color is not possible), a 
  189.             255 offset is applied (inverts result).
  190.           </p>
  191.             </dd>
  192.             <dt>
  193.               <span class="term">Alpha weighting</span>
  194.             </dt>
  195.             <dd>
  196.               <p>
  197.             If this option is not checked, the filter doesn't take in account transparency and this 
  198.             may be cause of some artefacts when blurring. 
  199.           </p>
  200.             </dd>
  201.           </dl>
  202.         </div>
  203.       </div>
  204.       <div class="simplesect" lang="en" xml:lang="en">
  205.         <div class="titlepage">
  206.           <div>
  207.             <div>
  208.               <h4 class="title"><a id="id2976430"></a>Examples</h4>
  209.             </div>
  210.           </div>
  211.           <div></div>
  212.         </div>
  213.         <div class="variablelist">
  214.           <dl>
  215.             <dt></dt>
  216.             <dd>
  217.               <p>
  218.             Design of kernels is based on high levels mathematics. You can find ready-made kernels on 
  219.             the Web. Here are some examples:
  220.           </p>
  221.             </dd>
  222.             <dt>
  223.               <span class="term">Sharpen</span>
  224.             </dt>
  225.             <dd>
  226.               <div class="mediaobject">
  227.                 <img src="../images/filters/examples/convolution-sharpen.png" />
  228.               </div>
  229.             </dd>
  230.             <dt>
  231.               <span class="term">Blur</span>
  232.             </dt>
  233.             <dd>
  234.               <div class="mediaobject">
  235.                 <img src="../images/filters/examples/convolution-blur.png" />
  236.               </div>
  237.             </dd>
  238.             <dt>
  239.               <span class="term">Edge enhance</span>
  240.             </dt>
  241.             <dd>
  242.               <div class="mediaobject">
  243.                 <img src="../images/filters/examples/convolution-edge.png" />
  244.               </div>
  245.             </dd>
  246.             <dt>
  247.               <span class="term">Edge detect</span>
  248.             </dt>
  249.             <dd>
  250.               <div class="mediaobject">
  251.                 <img src="../images/filters/examples/convolution-edge-detect1.png" />
  252.               </div>
  253.             </dd>
  254.             <dt>
  255.               <span class="term">Emboss</span>
  256.             </dt>
  257.             <dd>
  258.               <div class="mediaobject">
  259.                 <img src="../images/filters/examples/convolution-emboss.png" />
  260.               </div>
  261.             </dd>
  262.           </dl>
  263.         </div>
  264.       </div>
  265.     </div>
  266.     <div class="navfooter">
  267.       <hr />
  268.       <table width="100%" summary="Navigation footer">
  269.         <tr>
  270.           <td width="40%" align="left"><a accesskey="p" href="ch05s07.html">Prev</a>┬á</td>
  271.           <td width="20%" align="center">
  272.             <a accesskey="u" href="ch05s07.html">Up</a>
  273.           </td>
  274.           <td width="40%" align="right">┬á<a accesskey="n" href="ch05s07s03.html">Next</a></td>
  275.         </tr>
  276.         <tr>
  277.           <td width="40%" align="left" valign="top">7.┬áGeneric filters┬á</td>
  278.           <td width="20%" align="center">
  279.             <a accesskey="h" href="index.html">Home</a>
  280.           </td>
  281.           <td width="40%" align="right" valign="top">┬á7.3.┬áDilate</td>
  282.         </tr>
  283.       </table>
  284.     </div>
  285.   </body>
  286. </html>
  287.